package org.thanos.demo.controller.index;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.thanos.demo.service.MenuService;

@Controller
public class IndexController {

    @Autowired
    private MenuService menuService;

    @GetMapping("/")
    public String indexPage(Model model) {
        model.addAttribute("menus", menuService.queryAll());
        return "/index";
    }
}
